home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / ColorSync 2.5.1 SDK / Sample Code / CSDemo 2.5 / CSDemoSources / winProfileGetSet.c < prev    next >
Encoding:
Text File  |  1998-09-09  |  3.2 KB  |  107 lines  |  [TEXT/CWIE]

  1. // A profile window
  2. //
  3. // David Hayward 
  4. // Developer Technical Support
  5. // AppleLink: DEVSUPPORT
  6. //
  7. // Copyrite 1995, Apple Computer,Inc
  8. //
  9. // This file contains the getter/setter routines for
  10. // the ProfileDataHdl fields of a profile window.
  11. // 
  12. // 12/13/94    david    first cut
  13.  
  14.  
  15. #include "win.h"
  16. #include "winProfileGetSet.h"
  17.  
  18.  
  19. /*------------------------------------------------------------------------------*\
  20.     GetProfileRef / SetProfileRef
  21.  *------------------------------------------------------------------------------*
  22.         These routines get and set the ProfileRef field of the ProfileDataHdl
  23.         of the winRecord.
  24. \*------------------------------------------------------------------------------*/
  25. CMProfileRef GetProfileRef ( winHandle win )
  26. {
  27.     ProfileDataHdl    data ;
  28.         data = (ProfileDataHdl) GetWinData( win ) ;
  29.     if ( data==nil ) return nil;
  30.     return (**data).ProfileRef ;
  31. }
  32. void SetProfileRef ( winHandle win, CMProfileRef prof )
  33. {    
  34.     ProfileDataHdl    data ;
  35.     data = (ProfileDataHdl) GetWinData( win ) ;
  36.     if ( data==nil ) return ;
  37.     (**data).ProfileRef = prof ;
  38. }
  39.  
  40.  
  41. /*------------------------------------------------------------------------------*\
  42.     GetProfileIndex / SetProfileIndex
  43.  *------------------------------------------------------------------------------*
  44.         These routines get and set the Index field of the ProfileDataHdl
  45.         of the winRecord.
  46. \*------------------------------------------------------------------------------*/
  47. unsigned long GetProfileIndex ( winHandle win )
  48. {
  49.     ProfileDataHdl    data ;
  50.         data = (ProfileDataHdl) GetWinData( win ) ;
  51.     if ( data==nil ) return nil;
  52.     return (**data).Index ;
  53. }
  54. void SetProfileIndex ( winHandle win, unsigned long index )
  55. {    
  56.     ProfileDataHdl    data ;
  57.     data = (ProfileDataHdl) GetWinData( win ) ;
  58.     if ( data==nil ) return ;
  59.     (**data).Index = index ;
  60. }
  61.  
  62.  
  63. /*------------------------------------------------------------------------------*\
  64.     GetProfileMode / SetProfileMode
  65.  *------------------------------------------------------------------------------*
  66.         These routines get and set the Mode field of the ProfileDataHdl
  67.         of the winRecord.
  68. \*------------------------------------------------------------------------------*/
  69. unsigned long GetProfileMode ( winHandle win )
  70. {
  71.     ProfileDataHdl    data ;
  72.         data = (ProfileDataHdl) GetWinData( win ) ;
  73.     if ( data==nil ) return nil;
  74.     return (**data).Mode ;
  75. }
  76. void SetProfileMode ( winHandle win, unsigned long mode )
  77. {    
  78.     ProfileDataHdl    data ;
  79.     data = (ProfileDataHdl) GetWinData( win ) ;
  80.     if ( data==nil ) return ;
  81.     (**data).Mode = mode ;
  82. }
  83.  
  84. #if TryGettingAnEditableProfileName    
  85. /*------------------------------------------------------------------------------*\
  86.     GetProfileNameTEH / SetProfileNameTEH
  87.  *------------------------------------------------------------------------------*
  88.         These routines get and set the NameTEH field of the ProfileDataHdl
  89.         of the winRecord.
  90. \*------------------------------------------------------------------------------*/
  91. TEHandle GetProfileNameTEH ( winHandle win )
  92. {
  93.     ProfileDataHdl    data ;
  94.         data = (ProfileDataHdl) GetWinData( win ) ;
  95.     if ( data==nil ) return nil;
  96.     return (**data).NameTEH ;
  97. }
  98. void SetProfileNameTEH ( winHandle win, TEHandle nameTEH )
  99. {    
  100.     ProfileDataHdl    data ;
  101.     data = (ProfileDataHdl) GetWinData( win ) ;
  102.     if ( data==nil ) return ;
  103.     (**data).NameTEH = nameTEH ;
  104. }
  105. #endif
  106.  
  107.